package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.entity.Result;
import com.itheima.pojo.Map;
import com.itheima.service.MapService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;



@RestController
@RequestMapping("/address")
public class MapController {
    @Reference
    private MapService mapService;

    //查询地图中的坐标点
    @RequestMapping("/findMap")
    public Result findMap() {
        List<Map> lsit = mapService.findMap();
        ArrayList<String> address = new ArrayList<>();
        for (Map map : lsit) {
            address.add( map.getAddress());
        }

        return new Result(true, "地址请求成功", address);
    }
}

